package cn.edu.ujn.project.supermarket.service.impl;

import java.util.List;

import cn.edu.ujn.project.supermarket.extendbean.InportGoodsChild;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ujn.project.common.core.text.Convert;
import cn.edu.ujn.project.supermarket.domain.InportGoods;
import cn.edu.ujn.project.supermarket.mapper.InportGoodsMapper;
import cn.edu.ujn.project.supermarket.service.IInportGoodsService;

/**
 * 进货Service业务层处理
 * 
 * @author zhaomh
 * @date 2023-11-14
 */
@Service
public class InportGoodsServiceImpl implements IInportGoodsService 
{
    @Autowired
    private InportGoodsMapper inportGoodsMapper;

    /**
     * 查询进货
     * 
     * @param inportId 进货主键
     * @return 进货
     */
    @Override
    public InportGoods selectInportGoodsByInportId(String inportId)
    {
        return inportGoodsMapper.selectInportGoodsByInportId(inportId);
    }

    /**
     * 查询进货列表
     * 
     * @param inportGoods 进货
     * @return 进货
     */
    @Override
    public List<InportGoods> selectInportGoodsList(InportGoods inportGoods)
    {
        return inportGoodsMapper.selectInportGoodsList(inportGoods);
    }

    /**
     * 新增进货
     * 
     * @param inportGoods 进货
     * @return 结果
     */
    @Override
    public int insertInportGoods(InportGoods inportGoods)
    {
        return inportGoodsMapper.insertInportGoods(inportGoods);
    }

    /**
     * 修改进货
     * 
     * @param inportGoods 进货
     * @return 结果
     */
    @Override
    public int updateInportGoods(InportGoods inportGoods)
    {
        return inportGoodsMapper.updateInportGoods(inportGoods);
    }

    /**
     * 批量删除进货
     * 
     * @param inportIds 需要删除的进货主键
     * @return 结果
     */
    @Override
    public int deleteInportGoodsByInportIds(String inportIds)
    {
        return inportGoodsMapper.deleteInportGoodsByInportIds(Convert.toStrArray(inportIds));
    }

    /**
     * 删除进货信息
     * 
     * @param inportId 进货主键
     * @return 结果
     */
    @Override
    public int deleteInportGoodsByInportId(String inportId)
    {
        return inportGoodsMapper.deleteInportGoodsByInportId(inportId);
    }

    public List<InportGoodsChild> selectInportGoodsChildList(InportGoodsChild inportGoodsChild){
        return this.inportGoodsMapper.selectInportGoodsChildList(inportGoodsChild);
    }
}
